//
//  CZDetailNoDataCell.swift
//  GZWeibo007
//
//  Created by 易辉华 on 15/12/25.
//  Copyright © 2015年 Apple. All rights reserved.
//

import UIKit

class CZDetailNoDataCell: UITableViewCell {

    //MARK: - 属性
    //详细内容
    var message: String? {
        didSet {
            messageLabel.text = message
        }
    }
    
    required init?(coder aDecoder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
    
    
    override init(style: UITableViewCellStyle, reuseIdentifier: String?) {
        super.init(style: style, reuseIdentifier: reuseIdentifier)
        prepareUI()
    }

    
    
   
    //准备UI
    private func prepareUI() {
        contentView.addSubview(messageLabel)
        
        messageLabel.translatesAutoresizingMaskIntoConstraints = false
        
        contentView.addConstraints(NSLayoutConstraint.constraintsWithVisualFormat("H:|-0-[ml]-0-|", options: NSLayoutFormatOptions(rawValue: 0), metrics: nil, views: ["ml": messageLabel]))
        contentView.addConstraints(NSLayoutConstraint.constraintsWithVisualFormat("V:|-0-[ml(100)]-0-|", options: NSLayoutFormatOptions(rawValue: 0), metrics: nil, views: ["ml": messageLabel]))
    }
    
    //MARK: - 懒加载
    private lazy var messageLabel: UILabel = {
        let messageLabel = UILabel()
        messageLabel.textAlignment = NSTextAlignment.Center
        messageLabel.textColor = UIColor.lightGrayColor()
        messageLabel.font = UIFont.systemFontOfSize(14)
        messageLabel.backgroundColor = UIColor.whiteColor()
        
        return messageLabel
    }()

}
